#ifndef __PAGELIB_HPP__
#define __PAGELIB_HPP__

#include <vector>
#include <string>
#include <map>

using std::vector;
using std::string;
using std::pair;
using std::map;

class DirScanner;
class Configuration;
class FileProcessor;

//网页库类
class PageLib
{
public:
    PageLib(Configuration& conf,DirScanner& dirScanner,FileProcessor& fileProcessor);//构造函数
    ~PageLib() {}//析构函数

    void create();//创建网页库
    void store();//存储网页库和网页偏移库

private:
    DirScanner& _dirScanner;//目录扫描对象
    FileProcessor& _fileProcessor;  //文件预处理对象
    vector<string> _files;//存放格式化之后的网页
    map<int,pair<int,int> > _offsetLib;//存放每篇文档在网页库的位置信息
};

PageLib::PageLib(Configuration& conf,DirScanner& dirScanner,FileProcessor& fileProcessor)
: _dirScanner(dirScanner), _fileProcessor(fileProcessor)
{
}

#endif
